package com.bicon.base.data.service.botu.impl;

import com.bicon.base.data.pojo.botu.TAUser;
import com.bicon.base.data.common.Constants;
import com.bicon.base.data.common.exception.BusinessException;
import com.bicon.base.data.mapper.botu.TAUserMapper;
import com.bicon.base.data.service.botu.TAUserService;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;

import java.util.List;

import org.apache.commons.lang3.exception.ExceptionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * 账户表 服务实现类
 * </p>
 *
 * @author zhoutyianqi
 * @since 2018-07-25
 */
@Service("userService")
public class TAUserServiceImpl extends ServiceImpl<TAUserMapper, TAUser> implements TAUserService {

	private Logger logger = LoggerFactory.getLogger(this.getClass());
	
	@Transactional(propagation=Propagation.SUPPORTS,readOnly=true,rollbackFor=BusinessException.class)
	@Override
	public List<TAUser> findTAUser() {
		try {
			return this.baseMapper.selectForList();
		}catch(Exception ex) {
			logger.error("系统错误,错误原因:{}",ExceptionUtils.getMessage(ex.getCause()));
			throw new BusinessException(Constants.ERROR_STATE, "系统错误,错误原因:"+ExceptionUtils.getMessage(ex.getCause()));
		}
		
	}

}
